import { createRouter,createWebHashHistory } from "vue-router";

const router = createRouter({
    history: createWebHashHistory(),
    routes:[
        {
            path: "/home",
            name: "home",
            component: () => import("../views/Index.vue"),
        },
        // 
        {
            path: "/layout",
            name: "layout",
            component: () => import("../views/layout/Layout.vue"),
            children: [
                // 首页
                {
                    path: "/index",
                    name: "index",
                    component: () => import("../views/layout/index.vue"),
                },
                // 我的项目
                {
                    path: "/myItem",
                    name: "myItem",
                    component: () => import("../views/item/MyItem.vue"),
                },
                // 团队成员管理
                {
                    path: "/userItem",
                    name: "userItem",
                    component: () => import("../views/userItem/UserItem.vue"),
                },
                // 审核项目
                {
                    path: "/audit",
                    name: "audit",
                    component: () => import("../views/audit/Audit.vue"),
                },
                // 个人信息管理
                {
                    path: "/userInfo",
                    name: "userInfo",
                    component: () => import("../views/systeam/UserInfo.vue"),
                },
                // 修改密码
                {
                    path: "/changePwd",
                    name: "changePwd",
                    component: () => import("../views/systeam/ChangePwd.vue"),
                },
                // 消息中心
                {
                    path: "/message",
                    name: "message",
                    component: () => import("../views/systeam/Message.vue"),
                },
                // 参数管理
                {
                    path: "/parameter",
                    name: "parameter",
                    component: () => import("../views/systeam/Parameter.vue"),
                },
                // 用户管理
                {
                    path: "/users",
                    name: "users",
                    component: () => import("../views/systeam/Users.vue"),
                },
            ]
        },
        {
            path: "/login",
            name: "login",
            component: () => import("../views/login/AdminLogin.vue"),
        },
        // 重定向
        // {
        //     path: "/login",
        //     redirect: "/",
        // },
        // 用户登录
        {
            path: "/",
            name: "userLogin",
            component: () => import("../views/login/UserLogin.vue"),
        },
        // 注册
        {
            path: "/register",
            name: "register",
            component: () => import("../views/register/Register.vue"),
        },
        {
            path: '/userRegister',
            name: "userRegister",
            component: () => import("../views/register/UserRegister.vue"),
        },
        {
            path: '/adminRegister',
            name: "adminRegister",
            component: () => import("../views/register/AdminRegister.vue"),
        },
        {
            path: '/LimitsAuthority',
            name: "LimitsAuthority",
            component: () => import("../views/error/index.vue"),
        },
    ]
})

export default router;